/**
 * 
 */
package com.globalresources.business.impl;

import java.util.List;
import com.globalresources.po.City;
import com.globalresources.dao.inface.ICityDao;
import com.globalresources.business.inface.ICityService;

/**
 * @author songduanlei@gmail.com
 * @time Aug 6, 2009 6:47:21 PM
 */
public class CityServiceImpl implements ICityService {

	 private ICityDao cityDao;
	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.ICityService#deleteCity(com.globalresources.po.City)
	 */
	public boolean deleteCity(City city) {
		// TODO Auto-generated method stub
		return cityDao.deleteCity(city);
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.ICityService#getCityById(java.lang.String)
	 */
	public City getCityById(String id) {
		// TODO Auto-generated method stub
		return (City)(cityDao.findBySql("from City city where city.id='"+id+"'").get(0));
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.ICityService#listCity()
	 */
	public List<City> listCity() {
		// TODO Auto-generated method stub
		return cityDao.findAll();
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.ICityService#saveCity(com.globalresources.po.City)
	 */
	public boolean saveCity(City city) {
		// TODO Auto-generated method stub
		return cityDao.saveCity(city);
	}

	/* (non-Javadoc)
	 * @see com.globalresources.business.inface.ICityService#saveOrUpdateCity(com.globalresources.po.City)
	 */
	public boolean saveOrUpdateCity(City city) {
		// TODO Auto-generated method stub
		return cityDao.saveOrUpdateCity(city);
	}

	/**
	 * @return the cityDao
	 */
	public ICityDao getCityDao() {
		return cityDao;
	}

	/**
	 * @param cityDao the cityDao to set
	 */
	public void setCityDao(ICityDao cityDao) {
		this.cityDao = cityDao;
	}

}
